﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string appName = "DemoWin";
            IntPtr parentHwnd =  Win32WindowApi.FindWindow(null, appName);

            IntPtr winHwnd = Win32WindowApi.FindWindowEx(null, "点击我");   //获得按钮的句柄 
             
            //string winClassName = WindowBiz.GetClassName(appHwnd);
            //string textName = WindowHook.GetWinText(appHwnd);

             
        }

        private void SendBtn_Click(object sender, EventArgs e)
        {
            msgBox.Text = "已收到发送的消息...";
        }

        private void ReceiveBtn_Click(object sender, EventArgs e)
        {
            msgBox.Text = "";
        }
    }
}
